<?php
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
	header($_SERVER['HTTP_HOST']);
	exit();
}
?>
<div class="wrap">
		<a name="topGal" id="topGal"></a>
	<h2><?php _e('PhotoXhibit Image Attribute Editor', 'photoxhibit'); ?></h2>
    
    <div class="red_notice"><?php _e('This will only update alt text locally, will not update any services you may have used.', 'photoxhibit'); ?></div>

    <table cellpadding="3" cellspacing="0" border="0" style="padding-bottom:2em;">
        <tr>
            <td>
                <a href="admin.php?page=px_manage&amp;action=edit_styles&amp;pxgid=<?php echo $px_model->cur_gallery_id;?>"
                    ><?php _e('Edit Styles', 'photoxhibit'); ?></a></td>
            <td><a href="admin.php?page=px_build&amp;pxgid=<?php echo $px_model->cur_gallery_id;?>" class=""
                    ><?php _e('Edit Gallery', 'photoxhibit'); ?></a></td>
        </tr>
    </table>
    
	<div style="margin: auto; width: 650px; ">
		<table id="imgAltTable" width="100%"  border="0" cellspacing="3" cellpadding="3">
			<thead>
				<tr class="thead">
					<th width="20%"><?php _e('Img', 'photoxhibit'); ?></th>	
					<th width="80%" colspan="2"><?php _e('Alt Tag', 'photoxhibit'); ?></th>
				</tr>
			</thead>
<?php if($px_model->cur_image_group): ?>
			<tbody>
			<?php
				$i = 0;
				foreach($px_model->cur_image_group as $image) {
					if($i%2 == 0) {
						$style = 'style=\'background-color: #eee\'';
					}  else {
						$style = 'style=\'background-color: none\'';
					}
			?>
				<tr <?php echo $style;?>>
					<td><img src="<?php echo $image->photo_tnurl;?>"/></td>
					<td><input type="text" id="photo_alt-<?php echo $image->photo_id;?>" name="photo_alt" value="<?php echo $image->photo_alt;?>" size="50"/></td>
					<td width="20%"></td>
				</tr>
			<?php 
					$i++;
				}
			?>
			</tbody>
<?php else: ?>
			<tbody>
				<tr>
					<td colspan="3" align="center"><?php _e('-: No Image :-', 'photoxhibit'); ?></td>
				</tr>
			</tbody>
<?php endif;?>
		</table>
	</div>
</div>